#ifndef __CTRL_MAP_HOST_FACTORY_TEST_H
#define __CTRL_MAP_HOST_FACTORY_TEST_H

#include <stdint.h>
#include <string.h>

#ifdef __cplusplus
 extern "C" {
#endif

#define COMM_HOST_FACTORY_TEST_MODE_CONTROL                 0x00

#define COMM_PDA_SCREEN_CHECK                               0x09
#define COMM_PDA_COLOR_CHECK                                0x0A //Atmosphere lamp check
#define COMM_PDA_SUBG_PAIR_CMD                              0x0C //Pair
#define COMM_PDA_SUBG_PAIR_RES                              0x0D
#define COMM_PDA_STOP_KEY_CHECK                             0x0E //stop key check
#define COMM_PDA_KEY_CHECK                                  0x0F //mow ok home key check

#define COMM_PDA_CHARGE_STATION_PN                          0x10 //to 0x16, 16 bytes   cgs pn set
#define COMM_PDA_SUB_SIGNAL_RX_STRENGTH                     0x21 //rssi of sub-G
#define COMM_PDA_SUB_SIGNAL_TX_STRENGTH                     0x22 //rssi of sub-G
#define COMM_PDA_SHUT_DOWN                                  0x29 //PDA shut down

#define COMM_PDA_ECU_FIRMWARE_VERSION                       0x31 //0x20-0x21 ecu firmware version
#define COMM_PDA_ECU_PN                                     0x33 //0x33-0x3E  ecu pn
#define COMM_PDA_ECU_RANDOM_NUM                             0x3F //0x3F -0x41 ecu random num

#define COMM_PDA_ECU_CPUID                                  0x50 //0x50-0x5A  ecu cpuid
#define COMM_PDA_ECU_SUBG_CFG                               0x5B //0X5B~0X5C  subg_CFG
#define COMM_PDA_ECU_SUBG_CFG_LEN                           4

#define COMM_PDA_LAWN_MOTOR_START_STOP                      0x5D//
#define COMM_PDA_LAWN_MOTOR_SPEED_FEEDBACK                  0x5E//
#define COMM_PDA_GET_BUMPER_STATUS                          0x5F//

#define COMM_PDA_TCU_MOTOR_START_STOP                       0x60//
#define COMM_PDA_TCU_MOTOR_SPEED_FEEDBACK                   0x61//
#define COMM_PDA_LIFT_MOTOR_HALL_TEST                       0x62//
#define COMM_PDA_TCU_MOTOR_INSERT_STATUS                    0x63//
 
#define COMM_SALED_APP_STOP                                 0x72 //app stop : 1 ; bluetooth disconnected :2 
#define COMM_SALED_DRIVER_MOTOR_CMD                         0x73 //driver motor test 0:default 1:start test 2:stop test
#define COMM_SALED_READ_MOTOR_STATUS                        0x74 //read driver motor status 
#define COMM_SALED_RIGHT_MOTOR_SPEED                        0x75 //right driver motor speed 
#define COMM_SALED_LEFT_MOTOR_IQ                            0x76 //left driver motor iq 
#define COMM_SALED_RIGHT_MOTOR_IQ                           0x77 //right driver motor iq 

/* universal wheel lift hall detection */
#define COMM_SALED_LEFT_LIFT_HALL                           0x78 //left lift hall detection (not used for cooper)
#define COMM_SALED_RIGHT_LIFT_HALL                          0x79 //right lift hall detection 
#define COMM_SALED_BUMPER_HALL                              0x7A
#define COMM_SALED_SUBG_RX_RSSI                             0x7B
#define COMM_SALED_SUBG_TX_RSSI                             0x7C


#define COMM_PDA_BAT_SOC                                    0x84 //0-100  bat soc 
#define COMM_PDA_BAT_ERROR                                  0x85 //bat error
#define COMM_PDA_BAT_PARALLEL                               0x86 // bat parallel
#define COMM_PDA_BAT_NTC                                    0x87 
#define COMM_PDA_BAT_MRFS                                   0x88 //bat manifacturer 
#define COMM_PDA_BAT_PN                                     0x8C //bat pn
#define COMM_PDA_BAT_INFOR                                  0x8D //bat infor 

#define COMM_PDA_ECU_BOOT_VERSION                           0xA0 //ecu boot version

typedef void (*pfnCmdHandle)(uint8_t *, uint8_t, uint8_t, uint8_t);
typedef struct _CmdHandleList_
{
    int32_t      s32Index;
    pfnCmdHandle pfnHandle;
}CmdHandleList_st;

void doApPdaCmd(uint8_t *pu8Data, uint8_t u8DataSize, uint8_t u8Index, uint8_t u8Cmd, uint8_t u8SrcId);

extern uint16_t g_u16FacLiftMotorCtrl;
extern uint16_t g_u16FacLiftMotorResult;
extern uint16_t g_u16FacDriverMotorCtrl;

#ifdef __cplusplus
}
#endif

#endif
